package com.kunbo.cn.enumeration.core.logistics;
/**
 * 
 * <p>Title: CarState</p>
 * <p>Description: </p>
 * <p>Company: www.kunbo.cn</p> 
 * @author	yang'f
 * @date	2019年3月21日下午11:15:49
 * @version 1.0
 */
public enum CarState {
	free("空闲",1),occupy("占用",2),defriend("拉黑",3);
	// 成员变量  
    private String name;  
    private int index;  
 // 构造方法  
    private CarState(String name, int index) {  
        this.name = name;  
        this.index = index;  
    }  
    // 普通方法  
    public static String getName(int index) {  
        for (CarState c : CarState.values()) {  
            if (c.getIndex() == index) {  
                return c.name;  
            }  
        }  
        return "";  
    }  
    
 // get set 方法  
    public String getName() {  
        return name;  
    }  
    public void setName(String name) {  
        this.name = name;  
    }  
    public int getIndex() {  
        return index;  
    }  
    public void setIndex(int index) {  
        this.index = index;  
    } 

}
